\section{Tests and Results}
In this section the test results for the different implemented strategies are shown. 
The first part \ref{DSM} includes the strategies for the two move lag, the three move lag and the scenario where the ship can 
stay still in the discrete state model. 

The test results for the continuous state model can be found in the second part \ref{CSM}. There the random ship, the curve ship, the observing bombers and 
the hidden Markov model are tested. 
\label{Tests}
\subsection{Hit rate tests for discrete state model}
\label{DSM}
This section handles the tests where the different ship strategies play against the different bomber strategies in the discrete state model.

For the original problem with two-time lag and no opportunity for the ship to stay still, two combinations are tested: The optimal ship from section \ref{Strategy2LagShip} against 
the optimal bomber from section \ref{Strategy2LagBomber} and against the observing bomber described in section \ref{ObservingBomber}. For the three-move lag, the ship can use 
the strategies \textit{ship Ferguson} and \textit{ship LeeLee}, worked out in sections \ref{StrategyFerguson3Lag} and \ref{StrategyLeeLee}. 
These two strategies are tested against the observing bomber. 
The observing bomber is also used for the test of the modification where the ship can stay still and uses the adjusted probabilities to move forwards and to stay still, explained 
in section \ref{ShipCanStandStill}.

The principle of the tests is that after a certain number of games the average hit rate is calculated and compared to the expected, theoretical value.
\subsubsection{Two-move lag: optimal ship Ferguson vs. optimal bomber Ferguson}
At first the original problem, where the optimal strategies for bomber and ship play against each other, is tested.
\paragraph{Experimental set up}
\begin{itemize}
 \item $n=1,2,3,4$
 \item Probability to move forwards $p=\frac{\sqrt{n^2+4}-n}{2}$ (see section \ref{Strategy2Lag})
\item Calculate a 95\% confidence interval
\item Average hit rate of 100,000 games
\item Goal: check if the hit rate corresponds to the value from the paper \cite{Ferguson} (see section \ref{Strategy2Lag}): $v_n= \frac{n^2+2-n*\sqrt{n^2+4}}{2}$

\end{itemize}

\paragraph{Results}
In table \ref{optShipvsoptBomber} the results for this test are shown. It shows, for $n=1,2,3,4$, the used probabilities $p$ 
to move forwards and the average hit rate $\mu$. $\text{Low} \mu$ and $\text{high} \mu$ mark the borders 
of the confidence interval. The last column $v$ shows the expected, theoretical value. 
It can be seen that for $n=1,2,3,4$ the theoretical value always lies in the 
confidence interval of the hit rate calculated after 100,000 games, which verifies that the strategies are optimal. 

\begin{table}[h]
\begin{center}
\resizebox{8cm}{!}{
 \begin{tabular}{|c|c|c|c|c|c|c|}
  \hline
n&p&$\mu$ &  $\text{low} \mu$ & $\text{high} \mu$ & v\\
\hline
1&0.6180&0.3836&0.3805&0.3866&0.3819\\
\hline
2&0.4142&0.1726&0.1702&0.1749&0.1716\\
\hline
3&0.3028&0.0923&0.0905&0.0941&0.0917\\
\hline
4&0.2361&0.0558&0.0544&0.0573&0.0557\\
\hline
 \end{tabular}}
\caption{Test results: ship Ferguson vs. bomber Ferguson, two-move lag}
\label{optShipvsoptBomber}
\end{center}
\end{table}


\subsubsection{Two-move lag: optimal ship Ferguson vs. observing bomber}
Since the observing bomber is the only strategy for the modifications where the bomb needs three time units to explode and where the ship can stay still, 
it is also tested for the original problem against the optimal ship. It makes it possible to check how good the observing bomber 
works, because the closer it comes to the expected value, the better. 
\paragraph{Experimental set up}
\begin{itemize}
 \item $n=1,2,3,4$
 \item Probability to move forwards $p=\frac{\sqrt{n^2+4}-n}{2}$
\item Determination of 95\% confidence interval
\item Average hit rate of 100 batches of 100 games for $n=1,2,3,4$
\item Bomber observes 500 movements before dropping the bomb
\item Goal: check if the observing bomber reaches a hit rate near the value from the paper \cite{Ferguson} (see section \ref{Strategy2Lag}): $v_n= \frac{n^2+2-n*\sqrt{n^2+4}}{2}$

\end{itemize}

\paragraph{Results}
The table \ref{shipFvsObservingBomber2Lag} below shows the results of this test. As you can see the average hit rate $\mu$ is for all $n$ lower than the hit rate $v$ of the optimal bomber. The observing bomber has on average 85\% of the quality from the optimal bomber of Ferguson for the two-move lag, which is described in section \ref{Strategy2LagBomber}. \\
The quality would be higher if there would be more movements of the ship observed by the bomber, but this increases the time it takes to play a game.
\begin{table}[h]
\begin{center}
\resizebox{8cm}{!}{
 \begin{tabular}{|c|c|c|c|c|c|c|}
  \hline
n&p&$\mu$ & $\sigma$ & $\text{low}\mu$ & $\text{high}\mu$ & v\\
\hline
1&0.6180&0.3358&0.0463&0.3329&0.3387&0.3819\\
\hline
2&0.4142&0.1431&0.0261&0.1408&0.1453&0.1716\\
\hline
3&0.3028&0.0776&0.0262&0.0759&0.0792&0.0917\\
\hline
4&0.2361&0.0474&0.0217&0.0460&0.0487&0.0557\\
\hline
 \end{tabular}}
\caption{Two-move lag: ship Ferguson vs. observing bomber}
\label{shipFvsObservingBomber2Lag}
\end{center}
\end{table}

\subsubsection{Three-move lag: ship Ferguson vs. observing bomber}
In the following the game between the ship, which uses Ferguson's strategy applied on three-move lag, and the observing bomber is presented.
\paragraph{Experimental set up}
\begin{itemize}
 \item $n=1,2,3,4$
\item Probability to move forwards $p$ from table \ref{table3lagF} (see section \ref{StrategyFerguson3Lag})
\item Determination of 95\% confidence interval
\item Average hit rate of 100 batches of 100 games
\item Bomber observes 500 movements before dropping the bomb
\item Goal: check if the hit rate corresponds to the values $v$ from table \ref{table3lagF} 
\end{itemize}

\paragraph{Results}
The test results can be read on table \ref{shipFergusonvsObservingBomber}. The theoretical value lies in the confidence interval of the hit rate resulting from 10,000 games for $n =2,3$, but not for $n=1,4$. 
The ship can ensure that the hit rate is not bigger than the values $v$ calculated in section \ref{StrategyFerguson3Lag} and it succeeds in this.
The observing bomber tries to raise the hit rate near to the value, but for $n=1,4$ it would be necessary to observe more than 
500 movements to reach the theoretical value. So, we conclude that the value is not always reached by the bomber, because the observing bomber is not optimal.

\begin{table}[h]
\begin{center}
\resizebox{8cm}{!}{
 \begin{tabular}{|c|c|c|c|c|c|c|}
  \hline
n&p&$\mu$ & $\sigma$ & $\text{low} \mu$ & $\text{high} \mu$ & v\\
\hline
1& 0.6667 & 0.2851& 0.0488 & 0.2754&0.2948&0.2963\\
\hline
2& 0.4385& 0.0856 & 0.0268& 0.0803 & 0.0909 & 0.0843 \\
\hline
3& 0.3139& 0.0283& 0.0142& 0.0255 & 0.0311 & 0.0309 \\
\hline
4&0.2417& 0.0118& 0.0111& 0.0096 & 0.0140 & 0.0141\\
\hline
 \end{tabular}}
\caption{Three-move lag: ship Ferguson vs. observing bomber}
\label{shipFergusonvsObservingBomber}
\end{center}
\end{table}


\subsubsection{Three-move lag: ship LeeLee vs. observing bomber}
The next test shows the result when the observing bomber plays against the ship which is using the strategy \textit{LeeLee} in the the three-move lag game.
\paragraph{Experimental set up}
\begin{itemize}
 \item $n=1$
\item Probability to move forwards depending on number of tails followed by number of straights in the past, according to section \ref{StrategyLeeLee}
\item Determination of 95\% confidence interval
\item Average hit rate of 100 batches of 100 games
\item Bomber observes 500 movements before dropping the bomb
\item Goal: check if the hit rate is lower or equal than the value 0.2883685 from the paper \cite{Isaacs} (see section \ref{StrategyLeeLee})

\end{itemize}

\paragraph{Results}
The test gives a hit rate of $\mu=0.2776$ with the confidence interval $\text{low} \mu = 0.2689$ and $\text{high} \mu= 0.2863$, which 
is less than the value from the paper $v=0.2883685$. So against the observing bomber the ship's strategy \textit{LeeLee} can ensure 
to be hit with a probability less than this theoretical value $v$. The observing bomber does not increase the hit rate up to the value $v$. 
It is not the best response to the ship's strategy since the observing bomber assumes that the ship only has one 
probability to move forwards, which is not the case for the strategy \textit{LeeLee}. 

This test also proves the theoretical assumption that for the three-move lag it is better for the ship to use the strategy \textit{LeeLee} instead of Ferguson's strategy 
described before. The hit rate decreases from $\mu_{Ferguson}=0.2851$ (see table \ref{shipFergusonvsObservingBomber}) to $\mu_{LeeLee}=0.2776$. 


\subsubsection{Two-move lag: ship can stay still vs. observing bomber}
The strategy where the ship can stay still is tested against the observing bomber.
\paragraph{Experimental set up}
\begin{itemize}
 \item $n=1,2,3,4$
\item Probability to move forwards $p$ and to stay still $s$ from table \ref{TableShipStandStill}, section \ref{ShipCanStandStill}
\item Determination of 95\% confidence interval for both situations: with and without option to stay still
\item Average hit rate of 100 batches of 100 games
\item Bomber observes 500 movements before dropping the bomb
\item Goal: check the difference between ships with and without staying still, both playing against observing bomber
\end{itemize}

\paragraph{Results}
The table \ref{shipStandStillvsObservingBomber} below shows the results of the test described before. 
The average hit rate with the option of staying still ($\mu_{stay}$) of the ship is smaller than the hit rate without the option of staying still ($\mu_{noStay}$) for all $n$. This result is quite obvious, because now the ship can be in more possible places, hence it is harder for the bomber to hit the ship. 

The main result of this test is that the influence of the staying still option for the ship decreases by increasing the value $n$ of the graph. This is shown by the value of $\frac{\mu_{stay}}{\mu_{noStay}}$ which is the ratio between the hit rate of staying still and the hit rate without staying still.
\begin{table}[h]
\begin{center}
\resizebox{8.5cm}{!}{
 \begin{tabular}{|c|c|c|c|c|c|c|c|}
  \hline
 & \multicolumn{3}{c|}{without staying still} & \multicolumn{3}{c|}{with staying still} &\\
\hline
n& $\text{low} \mu$ & $\text{high} \mu$ & $\mu_{noStay}$ &$\text{low} \mu$ & $\text{high} \mu$ &  $\mu_{stay}$ & $\frac{\mu_{stay}}{\mu_{noStay}}$\\
\hline
1& 0.3329 & 0.3386& 0.3358 & 0.1839&0.1973&0.1906& 56.76\%\\
\hline
2& 0.1408&0.1452&0.1431&0.1015&0.1133&0.1074&75.05\% \\
\hline
3& 0.0759&0.0792&0.0776&0.0591&0.0687&0.0639&82.35\%\\
\hline
4&0.0460&0.0487&0.0474&0.0353&0.0431&0.0392&82.7\%\\
\hline
 \end{tabular}}
\caption{Two-move lag: Ship can/cannot stay still vs. observing bomber}
\label{shipStandStillvsObservingBomber}
\end{center}
\end{table}

\subsection{Hit rate tests for continuous state model }
\label{CSM}
For the tests of the continuous state model the different implemented strategies play against each other 
for some number of games and then the average hit rate is calculated. 
The bomb has a certain hit radius and it takes two time units till it explodes. 

To see the difference between the bomber which takes the average and the bomber which takes the weighted average of the ship's 
last movements, 
both strategies play against the random ship and the curve ship (see section \ref{RandomShipAndObservingBomber}), 
and their average hit rate is compared. 
For the test of the hidden Markov model, the hidden Markov ship (see section \ref{HMCChapter}) plays against the different bomber 
strategies: average, weighted average and hidden Markov bomber. 

\subsubsection{Random ship vs. observing bomber}

This section shows the test results of the random ship against the observing bomber using the average of the last 
movements to predict the ship's next place and against the observing bomber which weights the last movements stronger than the movements 
farther back. 

\paragraph{Experimental set up}
\begin{itemize}
 \item Average hit rate of 100 batches of 100 games
\item Bomber observes 500 movements before dropping the bomb
\item Maximum ship velocity = 10
\item Hit radius = 2.5
\item Time lag = 2 
\item Goal: Check if it is better to take the average or the weighted average against the random ship
\end{itemize}


\paragraph{Results}
Table \ref{RandomvsObserving} shows the difference between the weighted and unweighted bomber against the random ship. 
It can be seen that in the case of a random ship it does not make a significant difference for the hit rate if the
bomber is weighting or unweighted the observed information. That result is not surprising, because
the ship moves completely random with the realistic restrictions on the angle and velocity. 
\begin{table}[h]
\begin{center}
\resizebox{8.5cm}{!}{
 \begin{tabular}{|l|c|c|c|c|}
\hline
 &$\mu $ & $\sigma$&  $\text{low} \mu$ & $\text{high} \mu$  \\
\hline
unweighted bomber& 0.0862 & 0.0294 & 0.0804 & 0.0920 \\
\hline
weighted bomber & 0.0865 &0.0282 &0.0809 & 0.0921 \\
\hline
 \end{tabular}}
\caption{Comparison: Observing bomber taking weighted or unweighted average vs. random ship}
\label{RandomvsObserving}
\end{center}
\end{table}

\subsubsection{Curve ship vs. observing bomber}
In this section the test results where the ship, which is moving like it is shown on figure \ref{curveShip}, plays against the 
two different observing bombers (taking weighted and unweighted average) are presented.
\paragraph{Experimental set up}
\begin{itemize}
 \item Average hit rate of 100 batches of 100 games
\item Bomber observes 500 movements before dropping the bomb
\item Strategy ship = curve ship
\item Ship velocity = 10
\item Hit radius = 0.5
\item time lag = 2 
\item Goal: Check if it is better to take the average or the weighted average against the curve ship
\end{itemize}

\paragraph{Results}
The test results are shown in table \ref{curveShipvsObservingBomber}. 
In this case of the special ship function the hit rate of weighted bomber is a bit higher than the
one of the unweighted bomber. This means that the weighted bomber performs better in this special
case. The reason of this is that change in angle gets bigger and bigger over time and the weighted bomber takes the
bigger angles more into account than the unweighted bomber and so it is a more likely that the
weighted bomber hits the ship than the unweighted bomber does.
\begin{table}[h]
\begin{center}
\resizebox{8.5cm}{!}{
 \begin{tabular}{|l|c|c|c|c|}
\hline
 &$\mu $ & $\sigma$&  $\text{low} \mu$ & $\text{high} \mu$  \\
\hline
unweighted bomber & 0.0770 & 0.0292 & 0.0712 & 0.0828 \\
\hline
weighted bomber & 0.0793 &0.0298 &0.0734 & 0.0852 \\
\hline
 \end{tabular}}
\caption{Comparison: Observing bomber taking weighted or unweighted average vs. curve ship}
\label{curveShipvsObservingBomber}
\end{center}
\end{table}

\subsubsection{Test for hidden Markov model}
This subsection covers the test of the hidden Markov ship against the different bomber strategies: observing and hidden Markov bomber. 
In the case of the hidden Markov bomber it is also tested how much the bomber's knowledge about the 
model influences the hit rate. The following scenarios are checked: 
\begin{enumerate}
 \item Bomber with no information: The bomber knows nothing about the ship's model only that there are three states and three emissions. 
It observes the emissions and tries 
to detect the transition and emission probabilities and the current state of the ship and drops the bomb on the place with the highest probability. 
 \item Bomber with initial guess : The bomber does not know the exact transition and emission probabilities, but it can guess the basic distribution. This information is used as initial 
assumption to find the transition and emission probabilities. Also the current state has to be detected.
\item Bomber with probabilities: The bomber knows the exactly transition and emission probabilities and only has to find the current state. Depending on the current state, the emission with 
the highest probability is bombed.
\item Bomber with all information: The bomber knows everything; the transition and emission probabilities and the current state of the ship. It only has to find the place 
with the highest probability and drop the bomb there.
\end{enumerate}

\paragraph{Experimental set up}
\begin{itemize}
 \item Average hit rate of 100 batches of 100 games
\item Bomber observes 500 movements before dropping the bomb
\item Strategy ship = hidden Markov ship
\item Ship velocity = 1
\item Hit radius = 0.25882
\item Time lag = 2 
\item Goal: Compare the different strategies against the hidden Markov ship
\end{itemize}
 
\paragraph{Results}
The test results on table \ref{hmShipvsBomber} show that both observing bombers are better against the bomber which tries to find 
the hidden Markov model and has no information. It has to know at least an initial guess which is near to the original distribution of the 
transition and emission probabilities to increase the hit rate. But even than the improvement compared to the observing bomber is only about 2\%. 
If the bomber knows everything about the model, a big difference of about 66\% between the hidden Markov bomber and the observing bombers 
can be seen.

The test also clearifies that the more information the bomber has about the hidden Markov 
model, the more often it hits the ship.  By adding the correct transition and emission probabilities instead of using an initial good guess, the bomber only has to detect 
the current state and the hit rate increases by 19.23\%.
\begin{table}[h]
\begin{center}
\resizebox{8.8cm}{!}{
 \begin{tabular}{|l|c|c|c|c|}
\hline
 &$\mu $ & $\sigma$&  $\text{low} \mu$ & $\text{high} \mu$  \\
\hline
unweighted bomber & 0.2237 & 0.0417 & 0.2154 & 0.2320 \\
\hline
weighted bomber & 0.2211 &0.0461 &0.2120 & 0.2302 \\
\hline
\multicolumn{5}{|l|}{\textbf{Hidden Markov bomber} }\\
\hline
1.bomber with no information & 0.1994 & 0.0408& 0.1913 & 0.2075 \\
\hline
2.bomber with initial guess& 0.2283 & 0.0400 & 0.2204 & 0.2362 \\
\hline
3.bomber with probabilities & 0.2722&0.0502 & 0.2622& 0.2822\\
\hline
4.bomber with all information & 0.3690 & 0.0446 & 0.2601 & 0.3779\\
\hline
 \end{tabular}}
\caption{Comparison: bomber strategies vs. hidden Markov ship}
\label{hmShipvsBomber}
\end{center}
\end{table}